From: kaf24@freefall.cl.cam.ac.uk Date: Fri, 24 Sep 2004 16:42:48 +0000 (+0000) Subject: bitkeeper revision 1.1159.83.10 (41544e88xdk28a2dPYKcImhs23irug) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17400^2~572^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=38277cb6173eb7b9ea2b4cf3dbfede9febd955ea;p=xen.git bitkeeper revision 1.1159.83.10 (41544e88xdk28a2dPYKcImhs23irug) Only free_page_type() on a page that is not yet invalid. --- diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 8cb0b42366..0c3fcc5966 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -820,14 +820,23 @@ void put_page_type(struct pfn_info *page) nx = x - 1; ASSERT((x & PGT_count_mask) != 0); - ASSERT(x & PGT_validated); + + /* + * The page should always be validated while a reference is held. The + * exception is during domain destruction, when we forcibly invalidate + * page-table pages if we detect a referential loop. + * See domain.c:relinquish_list(). + */ + ASSERT((x & PGT_validated) || + test_bit(DF_DYING, &page->u.inuse.domain->flags)); if ( unlikely((nx & PGT_count_mask) == 0) ) { /* Record TLB information for flush later. Races are harmless. */ page->tlbflush_timestamp = tlbflush_clock; - if ( unlikely((nx & PGT_type_mask) <= PGT_l4_page_table) ) + if ( unlikely((nx & PGT_type_mask) <= PGT_l4_page_table) && + likely(nx & PGT_validated) ) { /* * Page-table pages must be unvalidated when count is zero. The